package com.sunwayworld.basemodule.business.outsource.resource.impl;

import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sunwayworld.basemodule.business.outsource.resource.LimsOutsourceSampleResource;
import com.sunwayworld.basemodule.business.outsource.service.LimsOutsourceSampleService;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;

@LogModule("外包单样本")
@RestController
@GikamBean
public class LimsOutsourceSampleResourceImpl implements LimsOutsourceSampleResource {

    @Autowired
    private LimsOutsourceSampleService limsOutsourceSampleService;

    @Override
    public LimsOutsourceSampleService getService() {
        return limsOutsourceSampleService;
    }

    @Log(value = "新增外包单样本", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Log(value = "编辑结果", type = LogType.UPDATE)
    @Override
    public JSONObject setResult(RestJsonWrapperBean wrapperBean) {
        return getService().setResult(wrapperBean);
    }

    @Log(value = "多选样本新增外包单样本", type = LogType.INSERT)
    @Override
    public JSONObject insertMulti(RestJsonWrapperBean wrapperBean) {
        return getService().insertMulti(wrapperBean);
    }
}
